package com.zrrd.gmall.cart.feign;

import com.zrrd.gmall.common.result.Result;
import com.zrrd.gmall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@FeignClient("service-cart")
public interface CartFeignClient {
    //添加购物车
    @PostMapping("/api/cart/addToCart/{skuId}/{skuNum}")
    public Result addToCart(@PathVariable("skuId") Long skuId,
                            @PathVariable("skuNum")Integer skuNum
                            );
    //给结算的选中购物车的列表
    @GetMapping("/api/cart/getCartCheckedList/{userId}")
    public List<CartInfo> getCartCheckedList(@PathVariable("userId") String userId);

    @GetMapping("/api/cart/loadCartCache/{userId}")
    public Result loadCartCache(@PathVariable("userId") String userId);
}
